<?php 	$wishlist =$this->wishlist;
if(!empty($wishlist)){
?>
<div class="container">					
			<section class="header_text text-center">
				<h2><span class="text-error">Wishlist</span></h2>
			</section>			
			<section class="main-content">				
				<div class="fluid-row">
					<div class="span2"></div>
					<form action="wishlist.php" method="POST"> 
					<div class="span8">					
						<p>Please use this form to update your wish list. You may change the quantities, move items to your cart for purchasing, or remove items entirely.</p>
						
						<table class="table table-striped">
							<thead>
								<tr>
									<th>Image</th>
									<th>Product Name</th>
									<th>Options</th>
									<th>Quantity</th>
									<th>Unit Price</th>
									<th>Total</th>
								</tr>
							</thead>
							<tbody>
								<?php 
								// Initialize the total:
								
									foreach($wishlist['items'] as $product) 
								{								
								echo '<tr>
								 		
										<td><a href="product.php?id='.$product['pid'].'"><img width="50px" height="50px" alt="" src="static/products/'.$product['image'].'"></a></td>
										<td>'.$product['name'].'</td>
										<td><a href="cart.php?pid=' . $product['pid'] . '&action=move&qty=' . $product['quantity'] .'">Move to Cart</a><br /><a href="wishlist.php?pid=' . $product['pid'] . '&action=remove">Remove from Wishlist</a></td>
										<td><input type="text" placeholder="1" class="input-mini" name="quantity[' . $product['pid'] . ']" value="' . $product['quantity'] . '"></td>
										<td>INR '.$product['finalprice'].'</td>
										<td>INR '.$product['subtotal'].'</td>
									</tr>';					
								
							
								}
								?>				  
								
							</tbody>
						</table>
						<hr>
						
						<p class="buttons text-right">				
							<button class="btn" type="submit">Update</button>	
							<button class="btn" type="button">Continue</button>
						</p>											
					</div>
					</form>
					<div class="span2"></div>
				</div>
			</section>

</div>
<?php 
	}
	else
	{
	?>
		<div class="container">
				    <section class="header_text text-center">
						<h2><span class="text-error">Wishlist</span></h2>
					</section>	
				    <div class="alert alert-error">
            				<p class="text-center">Your Wishlist is currently empty.</p>
				    </div>
		</div>
	<?php
	}
	?>	
